//
//  NewsCell.m
//  MyMovie
//
//  Created by apple on 16/5/13.
//  Copyright © 2016年 ljp. All rights reserved.
//

#import "NewsCell.h"
#import "UIImageView+WebCache.h"

@implementation NewsCell

-(void)setNews:(News *)news {

    if (_news == news) {
        return;
    }
    self.titleLable.text = news.title;

    NSURL *url = [NSURL URLWithString:news.imageName];

    [self.newsImageView sd_setImageWithURL:url];

    if (news.type == NewsTypeNone) {
        self.typeImageView.image = nil;
        self.summaryLable.text = news.summary;

    }else if(news.type == NewsTypeImage){
        self.typeImageView.image = [UIImage imageNamed:@"sctpxw"];
        self.summaryLable.text = [NSString stringWithFormat:@"    %@", news.summary];
    }else if (news.type == NewsTypeVideo) {
        self.typeImageView.image = [UIImage imageNamed:@"scspxw"];

        self.summaryLable.text = [NSString stringWithFormat:@"    %@", news.summary];

    }

    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
